{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "NATS-Bench version: v1.3\n",
      "[2021-04-08 03:54:14] Try to use the default NATS-Bench (topology) path from fast_mode=True and path=None.\n",
      "[2021-04-08 03:54:14] Create NATS-Bench (topology) done with 0/15625 architectures avaliable.\n"
     ]
    }
   ],
   "source": [
    "#\n",
    "# Aims to solve the issue mentioned in https://github.com/D-X-Y/NATS-Bench/issues/7\n",
    "#\n",
    "import nats_bench\n",
    "\n",
    "print('NATS-Bench version: {:}'.format(nats_bench.version()))\n",
    "# Create the API for tologoy search space\n",
    "api = nats_bench.create(None, 'tss', fast_mode=True, verbose=True)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [],
   "source": [
    "# Find the best architecture on CIFAR-10 validation set\n",
    "api.verbose = False\n",
    "best_arch_index, highest_valid_accuracy = api.find_best(dataset='cifar10-valid', metric_on_set='x-valid', hp='12')"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2021-04-08 04:48:19] The best architecture on CIFAR-10 validation set with 12-epoch training is: [13714] |nor_conv_3x3~0|+|nor_conv_3x3~0|nor_conv_3x3~1|+|skip_connect~0|nor_conv_1x1~1|nor_conv_3x3~2|\n"
     ]
    }
   ],
   "source": [
    "print('{:} The best architecture on CIFAR-10 validation set with 12-epoch training is: [{:}] {:}'.format(\n",
    "    nats_bench.api_utils.time_string(), best_arch_index, api.arch(best_arch_index)))"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.8.8"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
